import Home from "../views/Home";
import Book from "../views/Book";
import Date from "../views/Date";
import Me from "../views/Me";
import Not from "../views/404"
import Record from '../views/Me/record'
import Order from '../views/Me/order'
import Comment from '../views/Me/comment'
import Tuisong from "../views/Me/detail/tuisong"
import Xitong from "../views/Me/detail/xitong";
import Help from "../views/Me/detail/help";
import Detail from "../views/common/detail_text"; 
import Login from '../views/login'
import Shelf from '../views/Me/shelf'
import BookDetail from "../views/common/bookDetail";
import AuthorDetail from "../views/common/authorDetail";
import DateList from '../views/Date/dateList'
import All from "../views/common/All"
import Shuku from "../views/Book/shuku"
import Input from "../components/Input/index";
import  Bianji from "../views/Me/bianji"
import { lazy } from 'react';

import {
  AaOutline,
  ArrowDownCircleOutline,
  AntOutline,
  CheckOutline,
  FileOutline,
  HistogramOutline,
  CalendarOutline,
  MessageOutline
} from "antd-mobile-icons";
function aaa(com) {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve(com)
    },500)
  })
}
export const routes = [
  {
    title: "首页",
    path: "/",
    element: Home,
    hidden: false,
    icon: AaOutline,
  },
  {
    title: "电子书",
    path: "/book",
    element: Book,
    hidden: false,
    icon: ArrowDownCircleOutline,
  },
  {
    title: "期刊",
    path: "/date",
    element: Date,
    hidden: false,
    icon: AntOutline,
  },
  {
    title: "我的",
    path: "/me",
    element: Me,
    hidden: false,
    icon: CheckOutline,
  },
  {
    title: "阅读记录",
    path: "record",
    element: Record,
    hidden: true,
    icon: FileOutline,
  },
  {
    title: "我的书架",
    path: "shelf",
    element: lazy(() => aaa(import("../views/Me/shelf"))),
    hidden: true,
    icon: HistogramOutline,
  },
  {
    title: "我的订单",
    path: "order",
    element: Order,
    hidden: true,
    icon: CalendarOutline,
  },
  {
    title: "我的评论",
    path: "comment",
    element: Comment,
    hidden: true,
    icon: MessageOutline,
  },
  {
    title: "推送消息",
    path: "tuisong",
    element: Tuisong,
    hidden: true,
  },
  {
    title: "系统通知",
    path: "xitong",
    element: Xitong,
    hidden: true,
  },
  {
    title: "帮助反馈",
    path: "help",
    element: Help,
    hidden: true,
  },

  {
    title: "登录",
    path: "/login",
    element: Login,
    hidden: true,
  },
  {
    title: "详情",
    path: "/detail/:id",
    element: lazy(() => aaa(import("../views/common/detail_text"))),
    hidden: true,
    icon: CheckOutline,
  },
  {
    title: "书籍详情",
    path: "/bookdetail/:id",
    element: lazy(() => aaa(import("../views/common/bookDetail"))),
    hidden: true,
    icon: CheckOutline,
  },
  {
    title: "作者详情",
    path: "/authordetail/:id",
    element: lazy(() => aaa(import("../views/common/authorDetail"))),
    hidden: true,
    icon: CheckOutline,
  },
  {
    title: "期刊列表页",
    path: "/author/:id/:name",
    element: lazy(() => aaa(import("../views/Date/dateList"))),
    hidden: true,
  },
  {
    title: "全部",
    path: "/all",
    element: lazy(() => aaa(import("../views/common/All"))),
    hidden: true,
  },
  {
    title: "书库页面",
    path: "/shuku",
    element: lazy(() => aaa(import("../views/Book/shuku"))),
    hidden: true,
  },
  {
    title: "搜索页面",
    path: "/input",
    element: Input,
    hidden: true,
  },
  {
    title: "编辑用户页面",
    path: "/bianji",
    element: Bianji,
    hidden: true,
  },

  {
    path: "*",
    element: Not,
    til: "404",
    hidden: true,
    icon: CheckOutline,
  },
];
